package com.ruoyi.project.digital.service.impl;


import com.ruoyi.project.digital.domain.WechatUser;
import com.ruoyi.project.digital.mapper.WechatUserMapper;
import com.ruoyi.project.digital.service.IWechatUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 用户Service业务层处理
 *
 * @author ruoyi
 * @date 2020-08-24
 */
@Service
public class WechatUserServiceImpl implements IWechatUserService
{
    @Autowired
    private WechatUserMapper wechatUserMapper;

    @Override
    public WechatUser selectWechatUserById(Long id)
    {
        return wechatUserMapper.selectWechatUserById(id);
    }

    /**
     * 新增用户
     * @return 结果
     */
    @Override
    public int insertWechatUser(WechatUser wechatUser)
    {
        return wechatUserMapper.insertWechatUser(wechatUser);
    }


    @Override
    public WechatUser selectByOpenId(String openId){
        WechatUser wu = new WechatUser();
        wu.setOpenId(openId);
        return wechatUserMapper.selectByOpenId(wu);
    }

}
